package com.xiaoshuidi.cloud.module.finance.dal.dataobject.finance;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class FinanceReconciliationData {
    private BigDecimal amount;
    private Integer total;
    private BigDecimal serviceFee;

    public boolean equalsTo(FinanceReconciliationData right) {
        return total.equals(right.getTotal()) && amount.add((serviceFee == null ? BigDecimal.ZERO : serviceFee))
                .compareTo(right.getAmount().add(right.getServiceFee() == null ? BigDecimal.ZERO : right.getServiceFee())) == 0;
    }
}
